﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GodPl
{
    public static class ColorExtensions
    {
        public static Color Plus(this Color c1, Color c2)
        {
            byte r = (byte)Math.Max(c1.R + c2.R, 255);
            byte g = (byte)Math.Max(c1.G + c2.G, 255);
            byte b = (byte)Math.Max(c1.B + c2.B, 255);
            byte a = (byte)Math.Max(c1.A + c2.A, 255);
            return new Color(r, g, b, a);
        }

        public static Color Times(this Color c1, Color c2)
        {
            var x = c1.ToVector4();
            var y = c2.ToVector4();
            var z = Vector4.Multiply(x, y);

            return new Color(z);
        }
    }
}
